//    https://ac.nowcoder.com/acm/problem/205350



#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    long long n;
    cin >> n;
    long long m = sqrt(n);
    long long k = ((m + 1) * (m + 1) - n) > (n - m * m) ? m * m : (m + 1) * (m + 1);
    cout << k << endl;
    return 0;
}